package com.persia.dao;

/**
 * 分页查询
 * @author caibosi
 * @created 2014-02-03
 */
public class Page {

    private Integer pageNo = 1;

    private Long totalCount;

    private Integer perPageSize = 20;


    public Integer getStart(){
        return  (pageNo - 1) * perPageSize;
    }

    public Integer getTotalPageCount(){
        return (int)Math.ceil(totalCount*1.0/perPageSize);
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }

    public Integer getPerPageSize() {
        return perPageSize;
    }

    public void setPerPageSize(Integer perPageSize) {
        this.perPageSize = perPageSize;
    }
}
